<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1">

<meta name="author" content="Jörg Kuharev &amp; Pedro Navarro" />

<meta name="date" content="2016-08-30" />

<title>LFQbench</title>



<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
  margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>


<link href="data:text/css;charset=utf-8,body%20%7B%0Abackground%2Dcolor%3A%20%23fff%3B%0Amargin%3A%201em%20auto%3B%0Amax%2Dwidth%3A%20700px%3B%0Aoverflow%3A%20visible%3B%0Apadding%2Dleft%3A%202em%3B%0Apadding%2Dright%3A%202em%3B%0Afont%2Dfamily%3A%20%22Open%20Sans%22%2C%20%22Helvetica%20Neue%22%2C%20Helvetica%2C%20Arial%2C%20sans%2Dserif%3B%0Afont%2Dsize%3A%2014px%3B%0Aline%2Dheight%3A%201%2E35%3B%0A%7D%0A%23header%20%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0A%23TOC%20%7B%0Aclear%3A%20both%3B%0Amargin%3A%200%200%2010px%2010px%3B%0Apadding%3A%204px%3B%0Awidth%3A%20400px%3B%0Aborder%3A%201px%20solid%20%23CCCCCC%3B%0Aborder%2Dradius%3A%205px%3B%0Abackground%2Dcolor%3A%20%23f6f6f6%3B%0Afont%2Dsize%3A%2013px%3B%0Aline%2Dheight%3A%201%2E3%3B%0A%7D%0A%23TOC%20%2Etoctitle%20%7B%0Afont%2Dweight%3A%20bold%3B%0Afont%2Dsize%3A%2015px%3B%0Amargin%2Dleft%3A%205px%3B%0A%7D%0A%23TOC%20ul%20%7B%0Apadding%2Dleft%3A%2040px%3B%0Amargin%2Dleft%3A%20%2D1%2E5em%3B%0Amargin%2Dtop%3A%205px%3B%0Amargin%2Dbottom%3A%205px%3B%0A%7D%0A%23TOC%20ul%20ul%20%7B%0Amargin%2Dleft%3A%20%2D2em%3B%0A%7D%0A%23TOC%20li%20%7B%0Aline%2Dheight%3A%2016px%3B%0A%7D%0Atable%20%7B%0Amargin%3A%201em%20auto%3B%0Aborder%2Dwidth%3A%201px%3B%0Aborder%2Dcolor%3A%20%23DDDDDD%3B%0Aborder%2Dstyle%3A%20outset%3B%0Aborder%2Dcollapse%3A%20collapse%3B%0A%7D%0Atable%20th%20%7B%0Aborder%2Dwidth%3A%202px%3B%0Apadding%3A%205px%3B%0Aborder%2Dstyle%3A%20inset%3B%0A%7D%0Atable%20td%20%7B%0Aborder%2Dwidth%3A%201px%3B%0Aborder%2Dstyle%3A%20inset%3B%0Aline%2Dheight%3A%2018px%3B%0Apadding%3A%205px%205px%3B%0A%7D%0Atable%2C%20table%20th%2C%20table%20td%20%7B%0Aborder%2Dleft%2Dstyle%3A%20none%3B%0Aborder%2Dright%2Dstyle%3A%20none%3B%0A%7D%0Atable%20thead%2C%20table%20tr%2Eeven%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0A%7D%0Ap%20%7B%0Amargin%3A%200%2E5em%200%3B%0A%7D%0Ablockquote%20%7B%0Abackground%2Dcolor%3A%20%23f6f6f6%3B%0Apadding%3A%200%2E25em%200%2E75em%3B%0A%7D%0Ahr%20%7B%0Aborder%2Dstyle%3A%20solid%3B%0Aborder%3A%20none%3B%0Aborder%2Dtop%3A%201px%20solid%20%23777%3B%0Amargin%3A%2028px%200%3B%0A%7D%0Adl%20%7B%0Amargin%2Dleft%3A%200%3B%0A%7D%0Adl%20dd%20%7B%0Amargin%2Dbottom%3A%2013px%3B%0Amargin%2Dleft%3A%2013px%3B%0A%7D%0Adl%20dt%20%7B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Aul%20%7B%0Amargin%2Dtop%3A%200%3B%0A%7D%0Aul%20li%20%7B%0Alist%2Dstyle%3A%20circle%20outside%3B%0A%7D%0Aul%20ul%20%7B%0Amargin%2Dbottom%3A%200%3B%0A%7D%0Apre%2C%20code%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0Aborder%2Dradius%3A%203px%3B%0Acolor%3A%20%23333%3B%0Awhite%2Dspace%3A%20pre%2Dwrap%3B%20%0A%7D%0Apre%20%7B%0Aborder%2Dradius%3A%203px%3B%0Amargin%3A%205px%200px%2010px%200px%3B%0Apadding%3A%2010px%3B%0A%7D%0Apre%3Anot%28%5Bclass%5D%29%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0A%7D%0Acode%20%7B%0Afont%2Dfamily%3A%20Consolas%2C%20Monaco%2C%20%27Courier%20New%27%2C%20monospace%3B%0Afont%2Dsize%3A%2085%25%3B%0A%7D%0Ap%20%3E%20code%2C%20li%20%3E%20code%20%7B%0Apadding%3A%202px%200px%3B%0A%7D%0Adiv%2Efigure%20%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0Aimg%20%7B%0Abackground%2Dcolor%3A%20%23FFFFFF%3B%0Apadding%3A%202px%3B%0Aborder%3A%201px%20solid%20%23DDDDDD%3B%0Aborder%2Dradius%3A%203px%3B%0Aborder%3A%201px%20solid%20%23CCCCCC%3B%0Amargin%3A%200%205px%3B%0A%7D%0Ah1%20%7B%0Amargin%2Dtop%3A%200%3B%0Afont%2Dsize%3A%2035px%3B%0Aline%2Dheight%3A%2040px%3B%0A%7D%0Ah2%20%7B%0Aborder%2Dbottom%3A%204px%20solid%20%23f7f7f7%3B%0Apadding%2Dtop%3A%2010px%3B%0Apadding%2Dbottom%3A%202px%3B%0Afont%2Dsize%3A%20145%25%3B%0A%7D%0Ah3%20%7B%0Aborder%2Dbottom%3A%202px%20solid%20%23f7f7f7%3B%0Apadding%2Dtop%3A%2010px%3B%0Afont%2Dsize%3A%20120%25%3B%0A%7D%0Ah4%20%7B%0Aborder%2Dbottom%3A%201px%20solid%20%23f7f7f7%3B%0Amargin%2Dleft%3A%208px%3B%0Afont%2Dsize%3A%20105%25%3B%0A%7D%0Ah5%2C%20h6%20%7B%0Aborder%2Dbottom%3A%201px%20solid%20%23ccc%3B%0Afont%2Dsize%3A%20105%25%3B%0A%7D%0Aa%20%7B%0Acolor%3A%20%230033dd%3B%0Atext%2Ddecoration%3A%20none%3B%0A%7D%0Aa%3Ahover%20%7B%0Acolor%3A%20%236666ff%3B%20%7D%0Aa%3Avisited%20%7B%0Acolor%3A%20%23800080%3B%20%7D%0Aa%3Avisited%3Ahover%20%7B%0Acolor%3A%20%23BB00BB%3B%20%7D%0Aa%5Bhref%5E%3D%22http%3A%22%5D%20%7B%0Atext%2Ddecoration%3A%20underline%3B%20%7D%0Aa%5Bhref%5E%3D%22https%3A%22%5D%20%7B%0Atext%2Ddecoration%3A%20underline%3B%20%7D%0A%0Acode%20%3E%20span%2Ekw%20%7B%20color%3A%20%23555%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Edt%20%7B%20color%3A%20%23902000%3B%20%7D%20%0Acode%20%3E%20span%2Edv%20%7B%20color%3A%20%2340a070%3B%20%7D%20%0Acode%20%3E%20span%2Ebn%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Efl%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Ech%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Est%20%7B%20color%3A%20%23d14%3B%20%7D%20%0Acode%20%3E%20span%2Eco%20%7B%20color%3A%20%23888888%3B%20font%2Dstyle%3A%20italic%3B%20%7D%20%0Acode%20%3E%20span%2Eot%20%7B%20color%3A%20%23007020%3B%20%7D%20%0Acode%20%3E%20span%2Eal%20%7B%20color%3A%20%23ff0000%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%0Acode%20%3E%20span%2Efu%20%7B%20color%3A%20%23900%3B%20font%2Dweight%3A%20bold%3B%20%7D%20%20code%20%3E%20span%2Eer%20%7B%20color%3A%20%23a61717%3B%20background%2Dcolor%3A%20%23e3d2d2%3B%20%7D%20%0A" rel="stylesheet" type="text/css" />

</head>

<body>



<div class="fluid-row" id="header">


<h1 class="title">LFQbench</h1>
<h4 class="author"><em>Jörg Kuharev &amp; Pedro Navarro</em></h4>
<h4 class="date"><em>2016-08-30</em></h4>

</div>


<p>LFQbench is an open source R package for the automated evaluation of label-free quantification performance. The evaluation bases on the interpretation of the quantitative analysis results of hybrid proteome samples prepared in known ratios.</p>
<p>LFQbench calculates and represents graphically a set of qualitative and quantitative performance metrics like identification rates, precision and accuracy of quantification, providing developers and end-users with a standardized set of reports to enable an in-depth performance evaluation of their software and analysis platforms.</p>
<div id="step-by-step-example" class="section level1">
<h1>Step by step example</h1>
<p>In this section we show and comment a stepwise analysis of a single report produced by ISOQuant (software for the quantitative post-processing analysis of Waters HDMS<sup>E</sup> data). The sample set is composed of two hybrid proteome samples with symmetric 10:1 and 1:10 expression ratios:</p>
<ul>
<li>65% HUMAN proteins in both samples</li>
<li>30% YEAST proteins in sample A and 3% in sample B</li>
<li>3% ECOLI proteins in sample A and 30% in sample B</li>
</ul>
<div id="define-sample-set-composition" class="section level2">
<h2>Define sample set composition</h2>
<p>The sample set composition is defined as a <em>data.frame</em> that contains a row per species and a column per sample. In addition to the number of samples, species names are stored in the first column. Following columns define corresponding relative protein amounts for each sample.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">sampleComposition =<span class="st"> </span><span class="kw">data.frame</span>( 
    <span class="dt">species =</span> <span class="kw">c</span>(<span class="st">&quot;HUMAN&quot;</span>,<span class="st">&quot;YEAST&quot;</span>, <span class="st">&quot;ECOLI&quot;</span>), 
    <span class="dt">A       =</span> <span class="kw">c</span>(  <span class="dv">67</span>,     <span class="dv">30</span>,       <span class="dv">3</span>   ), 
    <span class="dt">B       =</span> <span class="kw">c</span>(  <span class="dv">67</span>,      <span class="dv">3</span>,      <span class="dv">30</span>   )
)</code></pre></div>
</div>
<div id="define-the-data-sets-you-want-to-analyse." class="section level2">
<h2>Define the data sets you want to analyse.</h2>
<p>Each dataset is defined as a named vector of strings. The strings define the raw file names of the dataset as they are defined at the report(s) of the software tool(s) you want to benchmark. FSWE can analyse two samples (sample A and sample B), which defer on their species composition ratio. It is required to input the same number of replicates for both samples A and B. The first half of values of the named vector defining raw names is interpreted as sample A, and the second half is interpreted as sample B.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">dataSets =<span class="st"> </span><span class="kw">data.frame</span>(
    <span class="st">&quot;HYE110_SynaptG2S&quot;</span> =<span class="st"> </span><span class="kw">c</span>( 
        <span class="kw">paste</span>(<span class="kw">rep</span>(<span class="st">&quot;HYE110_A&quot;</span>), <span class="dv">1</span>:<span class="dv">3</span>, <span class="dt">sep =</span> <span class="st">&quot;.&quot;</span>), 
        <span class="kw">paste</span>(<span class="kw">rep</span>(<span class="st">&quot;HYE110_B&quot;</span>), <span class="dv">1</span>:<span class="dv">3</span>, <span class="dt">sep =</span> <span class="st">&quot;.&quot;</span>)
    ),
    <span class="dt">row.names =</span> <span class="kw">c</span>( <span class="st">&quot;A1&quot;</span>, <span class="st">&quot;A2&quot;</span>, <span class="st">&quot;A3&quot;</span>, <span class="st">&quot;B1&quot;</span>, <span class="st">&quot;B2&quot;</span>, <span class="st">&quot;B3&quot;</span> )
)</code></pre></div>
</div>
<div id="define-the-species-tags" class="section level2">
<h2>Define the species tags</h2>
<p>Protein names should provide a clue about the species. A convenient format is Uniprot’s entry name (example: 1433B_HUMAN is the entry name of the 14-3-3 protein beta/alpha of human). These species tags (clues) must be defined in FSWE as a named list.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">speciesTags =<span class="st"> </span><span class="kw">list</span>(
    <span class="dt">HUMAN =</span> <span class="st">&quot;_HUMAN&quot;</span>, 
    <span class="dt">YEAST =</span> <span class="st">&quot;_YEAS&quot;</span>, 
    <span class="dt">ECOLI =</span> <span class="st">&quot;_ECOLI&quot;</span>
)</code></pre></div>
</div>
<div id="initialize-lfqbench" class="section level2">
<h2>Initialize LFQbench</h2>
<p>Before using any LFQbench functionality, LFQbench library must be loaded and its modules must be initialized using <em>LFQbench.initConfiguration()</em> and <em>FSWE.initConfiguration()</em> functions. LFQbench module must be initialized before FSWE.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(LFQbench)

<span class="kw">LFQbench.initConfiguration</span>(
    <span class="dt">SampleComposition =</span> sampleComposition
)

<span class="kw">FSWE.initConfiguration</span>( 
    <span class="dt">injectionNames =</span> dataSets,
    <span class="dt">speciesTags =</span> speciesTags
)</code></pre></div>
<p><strong>Note</strong>: The initialization process will create new objects in the global R environment</p>
<ul>
<li><strong>LFQbench.Config</strong>: containing a list of configuration parameters for the analysis. The configuration values can be directly as paremeters of the command <em>LFQbench.initConfiguration()</em> or modified by using the command <em>LFQbench.changeConfiguration()</em> at a later time point.</li>
<li><strong>FSWE.modificationsToUniMod</strong>: a list of default fixed and variable modifications as they appear within the sequence, and their corresponding translation to UniMod. If you miss any modification, you may add it by using the function FSWE.addModification.</li>
<li><strong>FSWE.configFunctionForSoftware</strong>: this object contains configuration parameters to read each specific software tool report. There are many default software tool configurations (see FSWE.softwareNames), and you can add your own configurations by using FSWE.addSoftwareConfiguration.</li>
</ul>
</div>
<div id="define-data-root-folder" class="section level2">
<h2>Define data root folder</h2>
<p>Set the directory that stores all software tool reports as data root folder. You may also create a subfolder structure, which will contain LFQbench analyses.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">srcDir =<span class="st"> &quot;../ext/data/vignette_examples/hye110&quot;</span>

<span class="kw">LFQbench.setDataRootFolder</span>( 
    <span class="dt">rootFolder =</span> srcDir, 
    <span class="dt">createSubfolders =</span> T
)</code></pre></div>
</div>
<div id="add-configuration-for-isoquant-peptide-report" class="section level2">
<h2>Add configuration for ISOQuant peptide report</h2>
<p>FSWE already contains some predefined software report formats.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">print</span>( <span class="kw">paste</span>( FSWE.softwareNames, <span class="dt">collapse=</span><span class="st">&quot;,&quot;</span> ) )</code></pre></div>
<p>[1] “DIAumpire,DIAumpBuiltinProteins,OpenSWATH,PeakView,PViewNoFilter,PViewBuiltinProteins,Skyline,Spectronaut”</p>
<p>In case you need to add an extra software report format, it only requires to know some necessary column names. In this example, we use a non default software tool report from ISOQuant. We can configure it with the following command:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">FSWE.addSoftwareConfiguration</span>(
    <span class="co"># Software configuration name      </span>
    <span class="dt">softwareName =</span> <span class="st">&quot;ISOQuant_pep&quot;</span>,
    
    <span class="co"># input_format can be wide or long. </span>
    <span class="co"># Wide contains all quantitative values (all samples and replicates) </span>
    <span class="co"># for a peptide in a single row, </span>
    <span class="co"># whereas long contains a single quantitative value (just one replicate) in a row.</span>
    <span class="dt">input_format =</span> <span class="st">&quot;wide&quot;</span>,
    
    <span class="co"># it is important to know that LFQbench honours the extension: </span>
    <span class="co"># csv are COMMA separated values, </span>
    <span class="co"># tsv are TAB separated values</span>
    <span class="dt">input.extension =</span> <span class="st">&quot;*.csv$&quot;</span>,
    
    <span class="co"># how NA (not available) values are reported</span>
    <span class="dt">nastrings =</span> <span class="st">&quot; &quot;</span>,
    
    <span class="co"># in long formats, how the quantitative value column is named</span>
    <span class="dt">quantitative.var =</span> <span class="kw">make.names</span>(<span class="st">&quot;intensity in&quot;</span>),
    
    <span class="co"># in wide formats, how quantitative values are tagged </span>
    <span class="co">#(they also should include the injection names reported at the datasets object)</span>
    <span class="dt">quantitative.var.tag =</span> <span class="kw">make.names</span>(<span class="st">&quot;intensity in&quot;</span>),
    
    <span class="co"># name of the protein name variable. </span>
    <span class="co"># Remember: protein names should include species information (speciesTags)</span>
    <span class="dt">protein.var =</span> <span class="st">&quot;entry&quot;</span>,
    
    <span class="co"># variable name of sequence </span>
    <span class="co"># (including modifications as defined in FSWE.modificationsToUniMod)</span>
    <span class="dt">sequence.mod.var =</span> <span class="st">&quot;sequence&quot;</span>,
    
    <span class="co"># variable name of the precursar charge state.</span>
    <span class="dt">charge.var =</span> <span class="kw">make.names</span>(<span class="st">&quot;signal_charge&quot;</span>)
)</code></pre></div>
</div>
<div id="add-an-amino-acid-modification" class="section level2">
<h2>Add an amino acid modification</h2>
<p>You may add new modifications (or modifications reported in different ways for each software tool) by using the command <em>FSWE.addModification()</em>. You must use a regular expression compatible format to add modifications.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">FSWE.addModification</span>( 
    <span class="dt">modificationRegExps =</span> <span class="st">&quot;</span><span class="ch">\\</span><span class="st">[Oxi</span><span class="ch">\\</span><span class="st">]&quot;</span>,
    <span class="dt">UniModStrings =</span> <span class="st">&quot;</span><span class="ch">\\</span><span class="st">(UniMod:35</span><span class="ch">\\</span><span class="st">)&quot;</span>
)

<span class="co"># list modifications available</span>
<span class="kw">print</span>( FSWE.modificationsToUniMod )</code></pre></div>
</div>
<div id="generate-reports-in-lfqbench-format" class="section level2">
<h2>Generate reports in LFQbench format</h2>
<p>FSWE parses software tool reports, makes some common data processing (like adding up quantitative values of the different charge states for a same peptide), and outputs each analysed report file in two different files (peptide and protein summaries) compatible with LFQbench at the newly created <em>input</em> subfolder of the data root folder.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">inputFiles =<span class="st"> </span><span class="kw">list.files</span>(
    <span class="dt">path =</span> LFQbench.Config$DataRootFolder, 
    <span class="dt">pattern =</span> <span class="st">&quot;</span><span class="ch">\\</span><span class="st">..+&quot;</span>
)

nix =<span class="st"> </span><span class="kw">sapply</span>(
    inputFiles, 
    FSWE.generateReports,
        <span class="dt">softwareSource =</span> <span class="st">&quot;guess&quot;</span>,
        <span class="dt">keep_original_names =</span> T,
        <span class="dt">singleHits =</span> F,
        <span class="dt">plotHistogram =</span> T, 
        <span class="dt">plotHistNAs =</span> T, 
        <span class="dt">reportSequences =</span> F
)</code></pre></div>
<p><strong>Note</strong>: By default FSWE assigns the reading report configuration in function of the report name (softwareSource = “guess”). This is done by parsing the start of the file name and comparing it with the available <em>FSWE.softwareNames</em>. It is then recommendable to rename your files by including at the start the software name as it appears at the <em>FSWE.configFunctionForSoftware</em> (you can see the current available names at <em>FSWE.softwareNames</em>). In this execution, the current available names are: . By renaming the file names this way, you are able to run all LFQbench analyses of different software tools in the same LFQbench analysis batch.</p>
</div>
<div id="perform-lfqbench-analysis" class="section level2">
<h2>Perform LFQbench analysis</h2>
<p>LFQbench analyses can be run in a batch.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># some configuration changes for beautifying plots</span>
<span class="kw">LFQbench.changeConfiguration</span>(
    <span class="dt">LogIntensityPlotRange =</span> <span class="kw">c</span>(<span class="dv">9</span>,<span class="dv">21</span>),
    <span class="dt">LogRatioPlotRange =</span> <span class="kw">c</span>(-<span class="dv">7</span>,<span class="dv">7</span>)
)

<span class="co"># run batch analysis and keep result set</span>
res =<span class="st"> </span><span class="kw">LFQbench.batchProcessRootFolder</span>()</code></pre></div>
<p>All output files of a batch analysis will be stored at <em>log</em> and <em>plot</em> subfolders of the data root folder, and also they can be further used to represent data online.</p>
</div>
<div id="display-metrics" class="section level2">
<h2>Display metrics</h2>
<p>LFQbench produces a set of predefinet metrics for every benchmarked file. You can access this metrics using the function <em>LFQbench.getMetrics()</em>.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># getting the result set of the first benchmarked file</span>
rs =<span class="st"> </span>res[[<span class="dv">1</span>]]

m =<span class="st"> </span><span class="kw">LFQbench.getMetrics</span>( 
    <span class="dt">resultSet =</span> rs 
)

<span class="co"># get local accuracy and precision (by intensity tertiles)</span>
acc =<span class="st"> </span>m$<span class="st">`</span><span class="dt">Local accuracy</span><span class="st">`</span>$<span class="st">`</span><span class="dt">A:B</span><span class="st">`</span>
prec =<span class="st"> </span>m$<span class="st">`</span><span class="dt">Local precision</span><span class="st">`</span>$<span class="st">`</span><span class="dt">A:B</span><span class="st">`</span></code></pre></div>
<table>
<caption>Local accuracy</caption>
<thead>
<tr class="header">
<th></th>
<th align="right">HUMAN</th>
<th align="right">YEAST</th>
<th align="right">ECOLI</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Q1</td>
<td align="right">0.0407167</td>
<td align="right">0.0961928</td>
<td align="right">0.3142869</td>
</tr>
<tr class="even">
<td>Q2</td>
<td align="right">0.0099683</td>
<td align="right">-0.0211730</td>
<td align="right">-0.1345117</td>
</tr>
<tr class="odd">
<td>Q3</td>
<td align="right">-0.0336584</td>
<td align="right">-0.5847002</td>
<td align="right">0.2553325</td>
</tr>
</tbody>
</table>
<table>
<caption>Local precision</caption>
<thead>
<tr class="header">
<th></th>
<th align="right">HUMAN</th>
<th align="right">YEAST</th>
<th align="right">ECOLI</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Q1</td>
<td align="right">0.9431045</td>
<td align="right">1.763697</td>
<td align="right">1.7543298</td>
</tr>
<tr class="even">
<td>Q2</td>
<td align="right">0.7325138</td>
<td align="right">1.505324</td>
<td align="right">0.8127825</td>
</tr>
<tr class="odd">
<td>Q3</td>
<td align="right">0.6213687</td>
<td align="right">1.782097</td>
<td align="right">0.9078830</td>
</tr>
</tbody>
</table>
<p>Full list of predefined metrics: name,Identification statistics,Quantification statistics,Technical variance,Global accuracy,Global precision,Global species overlap,Local accuracy,Local precision,Local species overlap</p>
</div>
<div id="display-plots" class="section level2">
<h2>Display plots</h2>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># get the benchmark result for the first sample pair of the recently used result set</span>
samplePairRes =<span class="st"> </span>rs$result[[<span class="dv">1</span>]]

<span class="co"># display the scatter plot</span>
<span class="kw">LFQbench.showScatterAndBoxPlot</span>( 
    <span class="dt">samplePair =</span> samplePairRes, 
    <span class="dt">showLegend =</span> T 
)</code></pre></div>
<p><img src="" /></p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># display the distributions of log ratios</span>
<span class="kw">LFQbench.showDistributionDensityPlot</span>(
    <span class="dt">samplePair =</span> samplePairRes, 
    <span class="dt">showLegend =</span> F
)</code></pre></div>
<p><img src="" /></p>
</div>
</div>
<div id="at-once-example" class="section level1">
<h1>At once example</h1>
<p>In this section we show a complete analysis of two reports produced by Spectronaut and SWATH 2.0 (PeakView) software tools. The sample set is composed of two hybrid proteome samples with asymmetric 2:1 and 1:4 expression ratios:</p>
<ul>
<li>65% HUMAN proteins in both samples</li>
<li>30% YEAST proteins in sample A and 15% in sample B</li>
<li>5% ECOLI proteins in sample A and 20% in sample B</li>
</ul>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">sampleComposition =<span class="st"> </span><span class="kw">data.frame</span>(
  <span class="dt">species =</span> <span class="kw">c</span>(<span class="st">&quot;HUMAN&quot;</span>, <span class="st">&quot;YEAST&quot;</span>, <span class="st">&quot;ECOLI&quot;</span>),
  <span class="dt">A       =</span> <span class="kw">c</span>(  <span class="dv">65</span>,       <span class="dv">30</span>,     <span class="dv">05</span>   ),
  <span class="dt">B       =</span> <span class="kw">c</span>(  <span class="dv">65</span>,       <span class="dv">15</span>,     <span class="dv">20</span>   )
)

dataSets =<span class="st"> </span><span class="kw">data.frame</span>(
  <span class="st">&quot;HYE124_TTOF6600_64var&quot;</span> =<span class="st"> </span><span class="kw">c</span>(
    <span class="st">&quot;lgillet_I150211_008&quot;</span>, <span class="st">&quot;lgillet_I150211_010&quot;</span>, <span class="st">&quot;lgillet_I150211_012&quot;</span>, <span class="co"># A</span>
    <span class="st">&quot;lgillet_I150211_009&quot;</span>, <span class="st">&quot;lgillet_I150211_011&quot;</span>, <span class="st">&quot;lgillet_I150211_013&quot;</span>  <span class="co"># B</span>
  ),
  <span class="dt">row.names =</span> <span class="kw">c</span>( <span class="st">&quot;A1&quot;</span>, <span class="st">&quot;A2&quot;</span>, <span class="st">&quot;A3&quot;</span>, <span class="st">&quot;B1&quot;</span>, <span class="st">&quot;B2&quot;</span>, <span class="st">&quot;B3&quot;</span> )
)

speciesTags =<span class="st"> </span><span class="kw">list</span>(
  <span class="dt">HUMAN =</span> <span class="st">&quot;_HUMAN&quot;</span>, 
  <span class="dt">YEAST =</span> <span class="st">&quot;_YEAS&quot;</span>, 
  <span class="dt">ECOLI =</span> <span class="st">&quot;_ECOLI&quot;</span>
)

<span class="kw">LFQbench.initConfiguration</span>(
  <span class="dt">SampleComposition =</span> sampleComposition
)

<span class="kw">FSWE.initConfiguration</span>( 
  <span class="dt">injectionNames =</span> dataSets,
  <span class="dt">speciesTags =</span> speciesTags
)

<span class="co"># we don't need to define new software report format in this example</span>
<span class="co"># because Spectronaut and PeakView (SWATH 2.0) report formats are predefined in FSWE</span>

srcDir =<span class="st"> &quot;../ext/data/vignette_examples/hye124&quot;</span>

<span class="kw">LFQbench.setDataRootFolder</span>( 
  <span class="dt">rootFolder =</span> srcDir, 
  <span class="dt">createSubfolders =</span> T
)

inputFiles =<span class="st"> </span><span class="kw">list.files</span>(
  <span class="dt">path =</span> LFQbench.Config$DataRootFolder, 
  <span class="dt">pattern =</span> <span class="st">&quot;</span><span class="ch">\\</span><span class="st">..+&quot;</span>
)

nix =<span class="st"> </span><span class="kw">sapply</span>(
  inputFiles, 
  FSWE.generateReports,
  <span class="dt">softwareSource =</span> <span class="st">&quot;guess&quot;</span>,
  <span class="dt">keep_original_names =</span> T,
  <span class="dt">singleHits =</span> F,
  <span class="dt">plotHistogram =</span> T, 
  <span class="dt">plotHistNAs =</span> T, 
  <span class="dt">reportSequences =</span> F
)

hye124.res =<span class="st"> </span><span class="kw">LFQbench.batchProcessRootFolder</span>()</code></pre></div>
</div>



<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src  = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script>

</body>
</html>
